Skip to content

Instantly share code, notes, and snippets.

@wojteklu
wojteklu / clean_code.md
Last active May 10, 2024 05:30
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@lovasoa
lovasoa / node-walk.es6
Last active May 10, 2024 05:30
Walk through a directory recursively in node.js.
// ES6 version using asynchronous iterators, compatible with node v10.0+
const fs = require("fs");
const path = require("path");
async function* walk(dir) {
for await (const d of await fs.promises.opendir(dir)) {
const entry = path.join(dir, d.name);
if (d.isDirectory()) yield* walk(entry);
else if (d.isFile()) yield entry;
@hankei6km
hankei6km / git-rebase--onto-tldr.md
Last active May 10, 2024 05:29
git のブランチを別のブランチへ付け替える (git rebase --onto)

git のブランチを別のブランチへ付け替える (git rebase --onto)

たまに --onto を使おうと思うと忘れているのでメモ.

基本(普通に rebase)

これを

%%{init: { 
@robbibt
robbibt / dea_in_r.R
Last active May 10, 2024 05:29
Loading and analysing Digital Earth Australia Sentinel-2 data in R with `rstac` and `gdalcubes`
"""
This code demonstrates how to load Digital Earth Australia Sentinel-2 Analysis Ready Data into R.
It uses `rstac` to search for available data for a time and location using DEA's STAC endpoint,
and `gdalcubes` to load and analyse the data.
Functionality includes:
* Creating a custom pixel grid to reproject data into
* Apply a cloud mask using the "s2cloudless" cloud mask
* Combine data into seasonal composites
* Create an RGB animation
@aaronpolhamus
aaronpolhamus / map_clsloc.txt
Created May 12, 2016 01:21
Image net classes + labels
n02119789 1 kit_fox
n02100735 2 English_setter
n02110185 3 Siberian_husky
n02096294 4 Australian_terrier
n02102040 5 English_springer
n02066245 6 grey_whale
n02509815 7 lesser_panda
n02124075 8 Egyptian_cat
n02417914 9 ibex
n02123394 10 Persian_cat
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active May 10, 2024 05:27
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active May 10, 2024 05:26
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
@Andre-3001
Andre-3001 / QuickSlots.cpp
Last active May 10, 2024 05:25
Long Keyboard v83 - Stable Beta Release
//### Readme:
/*
Heads up about the quickslot tooltips on EzorsiaV2. There's a faulty approximation used in Client.cpp on line 121:
Memory::WriteInt(dwQuickSlotCWndVPos + 2, (600 - m_nGameHeight) / 2 - 427); //0x008DE8EE: lea edi,[eax-427]
According to my testing this line should just be
Memory::WriteInt(dwQuickSlotCWndVPos + 2, -500 );
similar to the line which immediately follows it
Memory::WriteInt(dwQuickSlotCWndHPos + 2, -798); //0x008DE8E5: lea ebx,[eax-647]
Roblox.Hack = {
original: 'missingno',
balance: 0,
initialized: 0,
loading: false,
items: [],
inventoryString: '<li class="list-item item-card ng-scope"><div class="item-card-container"><a class="item-card-link" href="%1" data-ytta-id="-"><div class="item-card-thumb-container"><div ng-hide="item.Product.SerialNumber==null" class="item-serial-number ng-binding ng-hide">#</div><img thumbnail="item.Thumbnail" image-retry="" class="item-card-thumb ng-isolate-scope" src="%2"></div><div class="text-overflow item-card-name ng-binding" title="%6 ">%6 </div></a><!-- ngIf: item.Item.AudioUrl --><div class="text-overflow item-card-creator"><span class="xsmall text-label">By</span> <a class="xsmall text-overflow text-link ng-binding" ng-href="%3" ng-hide="assetsListContent.assetItems.data.Data.PageType!==\'favorites\'&amp;&amp;currentData.category.name==\'Places\'&amp;&amp;(currentData.subcategory.name==\'My VIP Servers\'||currentData.subcategory.name==\'Other VIP Servers\')&amp;&amp;staticData.isOwnPage" href="%3"
#!/bin/bash
# by: Curtis Kapsak (curtis.kapsak@theiagen.com)
# 2021-07-30; updated 2022-03-03
#
# This script is for concatenating fastq.gz files that from a Nanopore sequencing run,
# specifically with barcoded/multiplexed sequencing runs. It will not overwrite the original fastq files, but rather
# concatenate fastqs for each barcoded sample, and write them to a single output directory.
#
# REQUIREMENTS:
# This script requires that fastq.gz files are arranged in the normal output/directory